<?php
$queryStr =$this->adminHelper()->pagesQuery();
$params = isset($this->params) ? $this->params : [];
?>
<?php if ($this->pageCount): ?>
    <ul class="pagination pagination-sm no-margin pull-right">
        <?php if (isset($this->previous)): ?>
            <li><a href="javascript:;" onclick="dberpAjaxList('<?php echo $this->url($this->route, $params, ['query'=>['page'=>1]]) . $queryStr; ?>', '<?php echo $this->showDivId;?>');"><<</a></li>
            <li><a href="javascript:;" onclick="dberpAjaxList('<?php echo $this->url($this->route, $params, ['query'=>['page'=>$this->previous]]) . $queryStr; ?>', '<?php echo $this->showDivId;?>');"><</a></li>
        <?php else: ?>
            <li class="disabled"><a href="#"><<</a></li>
            <li class="disabled"><a href="#"><</a></li>
        <?php endif; ?>

        <?php foreach ($this->pagesInRange as $page): ?>
            <?php if ($page != $this->current): ?>
                <li><a href="javascript:;" onclick="dberpAjaxList('<?php echo $this->url($this->route, $params, ['query'=>['page'=>$page]]) . $queryStr; ?>', '<?php echo $this->showDivId;?>');"><?php echo $this->escapeHtml($page); ?></a></li>
            <?php else: ?>
                <li class="active"><a href="#"><?php echo $this->escapeHtml($page); ?></a></li>
            <?php endif; ?>

        <?php endforeach; ?>

        <?php if (isset($this->next)): ?>
            <li><a href="javascript:;" onclick="dberpAjaxList('<?php echo $this->url($this->route, $params, ['query'=>['page'=>$this->next]]) . $queryStr; ?>', '<?php echo $this->showDivId;?>');">></a></li>
            <li><a href="javascript:;" onclick="dberpAjaxList('<?php echo $this->url($this->route, $params, ['query'=>['page'=>$this->pageCount]]) . $queryStr; ?>', '<?php echo $this->showDivId;?>');">>></a></li>
        <?php else: ?>
            <li class="disabled"><a href="#">></a></li>
            <li class="disabled"><a href="#">>></a></li>
        <?php endif; ?>
    </ul>
<?php endif; ?>